<!DOCTYPE html>
<!--[if IE 8]>
<html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]>
<html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en">
<!--<![endif]-->
<!-- BEGIN HEAD -->

<head>
    <meta charset="utf-8" />
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <script type="text/javascript">
        var isLogin = sessionStorage.getItem("isLogin");
        if (isLogin == null || isLogin == 0) {
            location.href = "login.html";
        }
    </script>
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="assets/global/plugins/font-awesome/css/google-css.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/simple-line-icons/simple-line-icons.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->


    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <link href="assets/global/plugins/bootstrap-toastr/toastr.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/select2/css/select2.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/select2/css/select2-bootstrap.min.css" rel="stylesheet" type="text/css" />
    <!--<link href="assets/global/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css"/>-->
    <!--<link href="assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.css" rel="stylesheet" type="text/css"/> -->
    <link href="assets/global/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css"/>
    <link href="assets/global/plugins/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css"/>
    <link href="assets/global/plugins/jquery-nestable/jquery.nestable.css" rel="stylesheet" type="text/css" />
    <!-- END PAGE LEVEL PLUGINS -->


    <!-- BEGIN THEME GLOBAL STYLES -->
    <link href="assets/global/css/components.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/global/css/plugins.min.css" rel="stylesheet" type="text/css" />
    <!-- END THEME GLOBAL STYLES -->
    <!-- BEGIN THEME LAYOUT STYLES -->
    <link href="assets/layouts/layout/css/layout.min.css" rel="stylesheet" type="text/css" />
    <link href="assets/layouts/layout/css/themes/darkblue.min.css" rel="stylesheet" type="text/css" id="style_color" />
    <link href="assets/layouts/layout/css/custom.min.css" rel="stylesheet" type="text/css" />

    <!-- END THEME LAYOUT STYLES -->

    <!--擴展樣式 -->
    <link href="css/common.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="favicon.ico" />
    <link href="css/wangEditor.css" rel="stylesheet" type="text/css" />

    <!--ztree-->
    <link rel="stylesheet" href="plugin/ztree/css/metroStyle/metroStyle.css" type="text/css">

    <!--运费模板-->
    <!--<link rel="stylesheet" href="css/free.css"/>-->

</head>


<body class="page-header-fixed page-sidebar-closed-hide-logo page-content-white">
    <div class="page-header navbar navbar-fixed-top">
        <div class="page-header-inner ">
            <div class="page-logo">
                <a href="index">
                    <img src="images/mp_default.jpg" style="width: 35px;height: 35px;position: relative;top:8px;" alt="" class="logo-default"
                    />
                </a>
                <span style="color: #ffffff;position: relative;top: 15px;left: 8px;" class="mp-name">微信·公众平台</span>
                <div class="menu-toggler sidebar-toggler">
                    <span></span>
                </div>
            </div>
            <a href="javascript:;" class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
                <span></span>
            </a>
            <div class="top-menu">
                <ul class="nav navbar-nav pull-right">
                    <li class="dropdown dropdown-user">
                        <a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
                            <span class="username username-hide-on-mobile">欢迎</span>
                            <i class="fa fa-angle-down"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-menu-default">
                            <li>
                                <a data-toggle="modal" href="#basic">
                                    <i class="icon-key"></i> 修改密码
                                </a>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown dropdown-quick-sidebar-toggler">
                        <a href="javascript:;" onclick="loginOut()" class="dropdown-toggle">
                            <i class="icon-logout"></i>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="clearfix"></div>


    <div class="modal fade" id="basic" tabindex="-1" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                    <h4 class="modal-title">修改密码</h4>
                </div>
                <div class="modal-body">
                    <form id="modify-pwd-form" action="javascript:;">
                        <div class="modal-body role_over">
                            <div class="form-horizontal">
                                <div class="form-group ">
                                    <label class="col-sm-3 control-label">旧密码:</label>
                                    <div class="col-sm-7">
                                        <input type="password" name="oldPwd" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group ">
                                    <label class="col-sm-3 control-label">新密码:</label>
                                    <div class="col-sm-7">
                                        <input type="password" name="newPwd" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group ">
                                    <label class="col-sm-3 control-label">新密码确认:</label>
                                    <div class="col-sm-7">
                                        <input type="password" name="newRapetPwd" class="form-control" />
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <div class="modal-footer">
                            <button type="button" class="btn dark btn-outline radius6" data-dismiss="modal"><i class="fa fa-remove"></i> 取消</button>
                            <button type="submit" id="savebtn" class="btn green md-yes radius6"><i class="fa fa-check"></i> 提交</button>
                        </div>
                    </form>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>


    <div class="page-container">


        <div class="page-sidebar-wrapper">
            <div class="page-sidebar navbar-collapse collapse">
                <ul class="page-sidebar-menu  page-header-fixed " data-keep-expanded="false" data-auto-scroll="true" data-slide-speed="200"
                    style="padding-top: 20px">
                    <li class="heading">
                        <h3 class="uppercase"><i class="fa fa-align-justify"></i> 菜单</h3>
                    </li>

                </ul>
            </div>
        </div>


        <div class="page-content-wrapper">
            <div class="page-content">
                <!-- BEGIN THEME PANEL -->
                <div class="theme-panel hidden-xs hidden-sm">
                    <div class="toggler"> </div>
                    <div class="toggler-close"> </div>
                    <div class="theme-options">
                        <div class="theme-option theme-colors clearfix">
                            <span> THEME COLOR </span>
                            <ul>
                                <li class="color-default current tooltips" data-style="default" data-container="body" data-original-title="Default"> </li>
                                <li class="color-darkblue tooltips" data-style="darkblue" data-container="body" data-original-title="Dark Blue"> </li>
                                <li class="color-blue tooltips" data-style="blue" data-container="body" data-original-title="Blue"> </li>
                                <li class="color-grey tooltips" data-style="grey" data-container="body" data-original-title="Grey"> </li>
                                <li class="color-light tooltips" data-style="light" data-container="body" data-original-title="Light"> </li>
                                <li class="color-light2 tooltips" data-style="light2" data-container="body" data-html="true" data-original-title="Light 2">
                                </li>
                            </ul>
                        </div>
                        <div class="theme-option">
                            <span> Theme Style </span>
                            <select class="layout-style-option form-control input-sm">
                                    <option value="square" selected="selected">Square corners</option>
                                    <option value="rounded">Rounded corners</option>
                                </select>
                        </div>
                        <div class="theme-option">
                            <span> Layout </span>
                            <select class="layout-option form-control input-sm">
                                    <option value="fluid" selected="selected">Fluid</option>
                                    <option value="boxed">Boxed</option>
                                </select>
                        </div>
                        <div class="theme-option">
                            <span> Header </span>
                            <select class="page-header-option form-control input-sm">
                                    <option value="fixed" selected="selected">Fixed</option>
                                    <option value="default">Default</option>
                                </select>
                        </div>
                        <div class="theme-option">
                            <span> Top Menu Dropdown</span>
                            <select class="page-header-top-dropdown-style-option form-control input-sm">
                                    <option value="light" selected="selected">Light</option>
                                    <option value="dark">Dark</option>
                                </select>
                        </div>
                        <div class="theme-option">
                            <span> Sidebar Mode</span>
                            <select class="sidebar-option form-control input-sm">
                                    <option value="fixed">Fixed</option>
                                    <option value="default" selected="selected">Default</option>
                                </select>
                        </div>
                        <div class="theme-option">
                            <span> Sidebar Menu </span>
                            <select class="sidebar-menu-option form-control input-sm">
                                    <option value="accordion" selected="selected">Accordion</option>
                                    <option value="hover">Hover</option>
                                </select>
                        </div>
                        <div class="theme-option">
                            <span> Sidebar Style </span>
                            <select class="sidebar-style-option form-control input-sm">
                                    <option value="default" selected="selected">Default</option>
                                    <option value="light">Light</option>
                                </select>
                        </div>
                        <div class="theme-option">
                            <span> Sidebar Position </span>
                            <select class="sidebar-pos-option form-control input-sm">
                                    <option value="left" selected="selected">Left</option>
                                    <option value="right">Right</option>
                                </select>
                        </div>
                        <div class="theme-option">
                            <span> Footer </span>
                            <select class="page-footer-option form-control input-sm">
                                    <option value="fixed">Fixed</option>
                                    <option value="default" selected="selected">Default</option>
                                </select>
                        </div>
                    </div>
                </div>
                <!-- END THEME PANEL -->


                <div class="page-bar">
                    <ul class="page-breadcrumb">
                        <li>
                            <a href="/"><i class="fa fa-home"></i> 首页</a>
                        </li>
                        <li>
                            <span></span>
                        </li>
                    </ul>
                </div>
                <h3 class="page-title">
                    <i class=""></i>
                    <span> </span>
                    <small></small>
                </h3>


                <div id="page-content" style="display:none">

                </div>
            </div>
        </div>
    </div>

    <div class="page-footer">
        <div class="page-footer-inner"> 2017 &copy; custom-admin by shinez.
            <a href="javascript:;" title="" target="_blank">技术支持</a>
        </div>
        <div class="scroll-to-top">
            <i class="icon-arrow-up"></i>
        </div>
    </div>

    <script src="assets/pages/scripts/moment.js" type="text/javascript"></script>
    <!-- BEGIN CORE PLUGINS -->
    <script src="assets/global/plugins/jquery.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/js.cookie.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/jquery.blockui.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-growl/jquery.bootstrap-growl.min.js" type="text/javascript"></script>
    <!-- END CORE PLUGINS -->


    <!-- BEGIN PAGE LEVEL PLUGINS 插件添加-->
    <script src="assets/global/plugins/bootbox/bootbox.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/moment.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-daterangepicker/daterangepicker.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-select/js/bootstrap-select.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/select2/js/select2.full.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/clockface/js/clockface.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/bootstrap-toastr/toastr.min.js" type="text/javascript"></script>
    <script src="assets/global/plugins/jquery-nestable/jquery.nestable.js" type="text/javascript"></script>
    <!-- END PAGE LEVEL PLUGINS -->


    <script src="js/custom.js" type="text/javascript"></script>

    <!-- BEGIN THEME GLOBAL SCRIPTS -->
    <script src="assets/global/scripts/app.min.js" type="text/javascript"></script>
    <!-- END THEME GLOBAL SCRIPTS -->


    <!-- BEGIN PAGE LEVEL SCRIPTS 自定义-->
    <!-- END PAGE LEVEL SCRIPTS -->

    <!-- BEGIN THEME LAYOUT SCRIPTS -->
    <script src="assets/layouts/layout/scripts/layout.min.js" type="text/javascript"></script>
    <script src="assets/layouts/layout/scripts/demo.min.js" type="text/javascript"></script>
    <script src="assets/layouts/global/scripts/quick-sidebar.min.js" type="text/javascript"></script>
    <!-- END THEME LAYOUT SCRIPTS -->


    <!--自定义datatable-->
    <script src="js/shinez-datatable.js" type="text/javascript"></script>

    <!--七牛-->
    <script type="text/javascript" src="js/qiniu-upload-init.js?v1"></script>
    <script type="text/javascript" src="plugin/plupload/plupload.full.min.js"></script>
    <script type="text/javascript" src="js/qiniu.min.js"></script>

    <!--二维码-->
    <script src="js/qrcode.min.js"></script>

    <!--ztree-->
    <script type="text/javascript" src="plugin/ztree/js/jquery.ztree.all-3.5.js"></script>
    <script type="text/javascript" src="plugin/ztree/js/jquery.ztree.core-3.5.js"></script>
    <script type="text/javascript" src="plugin/ztree/js/jquery.ztree.excheck-3.5.js"></script>

    <!--富文本-->
    <!--<script type="text/javascript" src="js/wangEditor.min.js"></script>-->

    <!--xss-->
    <script type="text/javascript" src="js/xss.js"></script>

    <script type="text/javascript" src="js/const.js"></script>

    <!--city-->
    <script type="text/javascript" src="js/jquery.cityselect.js"></script>

    <!--运费模板设置-->
    <script src="js/free.js" type="text/javascript"></script>
    <script type="text/javascript">
        if (location.hash == "") {
            history.replaceState(null, null, "/");
        }


        var map;
        var menuIcon = localStorage.menuIconMap;
        if (menuIcon != null) {
            map = JSON.parse(menuIcon);
        }

        //修改密码
        function modifyPassWordSubmit() {
            var oldPwd = $.trim($("#modify-pwd-form input[name='oldPwd']").val());
            var newPwd = $.trim($("#modify-pwd-form input[name='newPwd']").val());
            var newRapetPwd = $.trim($("#modify-pwd-form input[name='newRapetPwd']").val());

            if (oldPwd == '') {
                Shinez.tip('warning', '请输入旧密码');
                return;
            }
            if (newPwd == '') {
                Shinez.tip('warning', '请输入新密码');
                return;
            }
            if (newRapetPwd == '') {
                Shinez.tip('warning', '请再次输入新密码');
                return;
            }
            if (newPwd != newRapetPwd) {
                Shinez.tip('warning', '两次密码不匹配,请重新输入');
                return;
            }

            Shinez.put('/main/sys-user/pwd', {
                "oldPwd": oldPwd,
                "newPwd": newPwd
            }, function (ret) {
                if (ret.status == 0) {
                    Shinez.tip('success', "修改成功，请牢记您的新密码。");
                    $("#basic").modal("hide");
                    return;
                }
                if (ret.status == -1) {
                    Shinez.tip('error', "密码错误");
                }
            });
        }


        //地址栏监听
        window.addEventListener("popstate", function () {
            var currentState = history.state;
            if (currentState == null || currentState.html == null || currentState.html == "") {
                location.href = "/";
                return;
            }
            loadHtml(currentState.html);
            //        }
        });

        //加载静态页面
        function loadHtml(url) {
            var loadUrl = "/app" + url + ".html";
            var params = history.state.params;
            var key = url + ((params == null || params == "") ? "" : "?" + params);
            $("#page-content").html("").css("display", "none").load(loadUrl, function () {
                $("#page-content").fadeIn(300);
                if (map[key] != null) {
                    document.getElementsByClassName("page-title")[0].getElementsByTagName("i")[0].setAttribute(
                        "class", map[key].icon);
                    document.getElementsByClassName("page-title")[0].getElementsByTagName("span")[0].innerHTML =
                        map[key].menuName;
                }
            });
            //菜单样式处理
            var atags = $(".nav-link");
            $.each(atags, function (k, v) {
                if ($(v).attr("data-href") == url && $(v).attr("data-param") != null && $(v).attr("data-param") ==
                    params) {
                    $(v).parents(".nav-item").addClass("active open").siblings("li").removeClass("active open");
                    return false;
                }
            });
        }


        function registerMenuClick() {
            //菜单点击事件
            $("*[data-href]").on("click", function () {
                var loadHtmlName = this.getAttribute("data-href");
                var queryStr = this.getAttribute("data-param");
                var url = loadHtmlName + (queryStr == null || queryStr == "" ? "" : "?" + queryStr);
                var state = {};
                var paramArray = queryStr.split("&");
                var p;
                for (var i = 0; i < paramArray.length; ++i) {
                    p = paramArray[i].split("=");
                    state[p[0]] = p[1];
                }
                state["html"] = loadHtmlName;
                state["params"] = queryStr;
                if (location.pathname != "/") {
                    location.href = "/#" + url;
                    return;
                }
                history.pushState(state, null, "#" + url);
                loadHtml(loadHtmlName);
                //            history.pushState({
                //                url: loadHtmlName,
                //                queryStr:this.getAttribute("data-param")
                //            }, null, "#" + loadHtmlName);
            });
        }
        $(function () {

            //初次加载
            if (location.hash != "") {
                var url = location.hash.substring(1, location.hash.length);
                var state = {
                    "html": url
                };
                state["params"] = "";
                if (url.indexOf("?") != -1) {
                    state["html"] = url.substring(0, url.indexOf("?"));
                    var qs = url.substring(url.indexOf("?") + 1, url.length);
                    state["params"] = qs;
                    var paramArray = qs.split("&");
                    var p;
                    for (var i = 0; i < paramArray.length; ++i) {
                        p = paramArray[i].split("=");
                        state[p[0]] = p[1];
                    }
                }
                history.pushState(state, null, "#" + url);
                loadHtml(state.html);
            }
            document.getElementById("savebtn").onclick = modifyPassWordSubmit;




            //加载顶部UI

            if (!(localStorage.mpHeadImg == "null" || localStorage.mpHeadImg == null)) {
                $(".page-logo img").attr("src", localStorage.mpHeadImg);
            }

            $(".page-logo .mp-name").html(localStorage.mpNickName);
            $(".username").html(sessionStorage.nickname);

            //加载菜单
            var menus = sessionStorage.menus;
            if (menus != null) {
                var menusArray = JSON.parse(menus);
                var menusStr = "";
                var menuHrefTarget = "";
                var dataHref = "";
                var dataParam = "";
                var menuHref = "";
                menusArray.forEach(function (v, k) {
                    menusStr +=
                        '<li class="nav-item "><a href="javascript:;" class="nav-link nav-toggle"><i class="' +
                        v.icon + '"></i><span class="title">' + v.menuName + '</span>' +
                        '<span class="selected"></span><span class="arrow"></span></a>' +
                        '<ul class="sub-menu">';
                    v.sysMenus.forEach(function (v1, k1) {
                        // if (!v1.isMenu) return true;
                        if (v1.menuHref.indexOf("http") != -1) {
                            menuHrefTarget = 'target="_blank"';
                            menuHref = v1.menuHref;
                            dataHref = "";
                            dataParam = "";
                        } else {
                            menuHrefTarget = "";
                            menuHref = 'javascript:;';
                            dataHref = v1.menuHref == null ? "" : v1.menuHref;
                            dataParam = v1.queryString == null ? "" : v1.queryString;
                        }
                        menusStr += '<li class="nav-item "><a href=' + menuHref + '  ' +
                            menuHrefTarget + 'class="nav-link child-link" data-href=' +
                            dataHref + ' data-param=' + dataParam + '>' +
                            '<i class="' + v1.icon + '"></i> <span class="title">' + v1.menuName +
                            '</span></a></li>';
                    });
                    menusStr += '</ul></li>';
                });
                $(".page-sidebar-menu").append(menusStr);
                registerMenuClick();
            }

            //加载数据字典
            var dataDictStr = localStorage.getItem("dataDict");
            dataDict = JSON.parse(dataDictStr);

        });


        //登出
        function loginOut() {
            Shinez.post("/main/logout", function (ret) {
                if (ret.status == 0) {
                    localStorage.clear();
                    sessionStorage.clear();
                    Shinez.delCookie(custom.authAlias);
                } else {
                    Shinez.tip("error", ret.info);
                }
                location.href = "login.html";
            });
        }

        function replaceDataDict(val) {
            var v = dataDict[val];
            if (v != null)
                return v.dictName;
            return "";
        }
    </script>
</body>

</html>